#!/usr/bin/env node
var app = require('./app');
var cluster = require('cluster');
var numberCPUs = require('os').cpus().length;

app.set('port', process.env.PORT || 3000);

// 暂时不要采用cluster
//if(cluster.isMaster){
//
//  for(var i=0;i<numberCPUs;i++){
//    cluster.fork();
//  }
//  cluster.on('exit', function (worker, code, signal) {
//    console.log('Worker '+worker.process.pid + 'died.');
//  });
//
//}else{

  var server = app.listen(app.get('port'), function() {

    console.log('Express server listening on port ' + server.address().port);

  });

//}

/*
var server = app.listen(app.get('port'), function() {

  console.log('Express server listening on port ' + server.address().port);

});*/


